package com.zp.ojcodesandbox.controller;

import java.io.IOException;

public class DownLoadNeed {
    public static void main(String[] args) {
        String downCmd = "docker pull gcc";
        try {
            while (true){
                Thread.sleep(1000 * 60 * 3);
                Process process = Runtime.getRuntime().exec(downCmd);
                Integer getValue = process.exitValue();
                if (getValue == 0){
                    System.out.println("down ok");
                    break;
                } else {
                    System.out.println("down error");
                }
            }
        } catch (IOException | InterruptedException e) {
            System.out.println("down error");
            throw new RuntimeException(e);
        }
    }
}
